<?php
namespace Wap\Controller;

class EnrollRecordController extends EnrollController
{
    public function registe()
    {
        $legal = $this->isLegal( $this->enroll );
        if( !$legal ){
            $result['legal'] = $legal;
            $this->ajaxReturn( $result );
        }

        $data['username'] = I( "post.username", "", "" );
        $data['telephone'] = I( "post.telephone", "", "" );
        $data['company'] = I( "post.company", "", "" );
        $data['introduction'] = I( "post.introduction", "", "");
        $data['eid'] = $this->enroll;
        $enroll = D( "enroll" )->where( array( "id" => $data['eid'] ) )->find();
        $data['token'] = $enroll['token'];

        $mode = D( "enrollRecord" );
        $result = $mode->registe( $data );
        $result['legal'] = $legal;

        $this->ajaxReturn( $result );
    }
}
